home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / netzwerk / pronet / pronet20.lha / ProNET / source / utilities / pronet-page.s next >
Text File  |  1995-06-22  |  2KB  |  116 lines

  1. ;: pronet-page.s
  2. ;:
  3. ;: Macht auf dem anderen Amiga einen 'DisplayAlert' !!
  4. ;:
  5. ;: 27-10-94
  6. ;:
  7. ;: 18-06-95    unitnumber argument. v34.0
  8.  
  9.         include    "exec/exec.i"
  10.         include    "A:ProNET/include/devices/pronet.i"
  11.         include    "A:ProNET/source/network.i"
  12.         include    "exec_lib.i"
  13.         include    "A:OSmacros.i"
  14.  
  15. j        cmp.l    #2,d0
  16.         bcs.s    nopronet
  17.  
  18.         lea    buffer,a1
  19. .lp        move.b    (a0)+,(a1)+
  20.         subq.l    #1,d0
  21.         bne.s    .lp
  22.         clr.b    (a1)+
  23.  
  24.         lea    buffer,a0
  25.         bsr    dec2long
  26.         move.l    d1,unit
  27.  
  28.         move.l    a0,a5
  29.         moveq    #-1,d5
  30. .count        tst.b    (a0)+
  31.         dbeq    d5,.count
  32.         neg.w    d5
  33.         subq.w    #1,d5
  34.         ext.l    d5
  35.  
  36.         move.l    4.w,a6
  37.         bsr    startpronet
  38.         tst.w    d0
  39.         bne    nopronet
  40.  
  41.         move.l    4.w,a6
  42.         move.l    pronetio(pc),a1
  43.         move.w    #0,pnr_NetDestPort(a1)
  44.         move.w    #PND_WRITE,IO_COMMAND(a1)
  45.         move.l    #testbuf,pnr_Data1(a1)
  46.         move.l    #4,pnr_Length1(a1)
  47.         move.l    a5,pnr_Data2(a1)
  48.         move.l    d5,pnr_Length2(a1)
  49.         LIBCALL    DoIO
  50.  
  51.         bsr    stoppronet
  52. nopronet    moveq    #0,d0
  53.         rts
  54.  
  55.         dc.b    "$VER: pronet-page 34.0 (18-06-95)",13,10,0
  56.         even
  57.  
  58. startpronet    moveq    #pnr_Size,d0
  59.         bsr    GetIORequest
  60.         move.l    d0,pronetio
  61.         beq    spnoioreq
  62.         bsr    CreatePort
  63.         move.l    d0,msgport
  64.         beq    spnomsgport
  65.         lea    pronetname,a0
  66.         move.l    unit(pc),d0
  67.         moveq    #0,d1
  68.         move.l    pronetio(pc),a1
  69.         move.w    #PNP_NEXTFREE,pnr_NetSourcePort(a1)
  70.         move.l    msgport(pc),pnr_MsgPort(a1)
  71.         move.l    4.w,a6
  72.         LIBCALL    OpenDevice
  73.         tst.l    d0
  74.         bne    spnodev
  75.         moveq    #0,d0
  76.         rts
  77.  
  78. stoppronet    move.l    4.w,a6
  79.         move.l    pronetio(pc),a1
  80.         LIBCALL    CloseDevice
  81. spnodev        move.l    msgport(pc),a0
  82.         bsr    DeletePort
  83. spnomsgport    move.l    pronetio(pc),a0
  84.         bsr    FreeIORequest
  85. spnoioreq    moveq    #-1,d0
  86.         rts
  87.  
  88. pronetname    dc.b    "pronet.device",0
  89.         even
  90. testbuf        dc.l    ACTION_PAGE
  91.  
  92. pronetio    dc.l    0
  93. msgport        dc.l    0
  94. unit        dc.l    0
  95.  
  96. dec2long    ; konvertiert Dezimalstring ab (a0) zu Longword in D1 !!
  97.         moveq    #0,d1
  98. .loop        moveq    #0,d0
  99.         move.b    (a0)+,d0
  100.         sub.b    #"0",d0
  101.         cmp.b    #9,d0
  102.         bhi.s    .oki
  103.         move.l    d1,d2
  104.         lsl.l    #3,d1
  105.         add.l    d2,d1
  106.         add.l    d2,d1
  107.         add.l    d0,d1
  108.         bra.s    .loop
  109. .oki        rts
  110.  
  111.         include    "A:ProNET/source/devio.s"
  112.  
  113.         section    b,bss
  114.  
  115. buffer        ds.b    256
  116.